package com.wyk.controller;

import com.wyk.common.Result;
import com.wyk.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WangYuKai
 * @Date 2022/6/23
 * @apiNote
 */
@RestController
@Slf4j
public class FeignController {
    //注入service层
    @Autowired
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/feign/payment/{id}")
    public Result getFeignOrder(@PathVariable("id") Integer id){
        return paymentFeignService.getPaymentById(id);
    }

    @GetMapping("/consumer/payment/timeout")
    public String getPaymentTimeOut(){
        return paymentFeignService.getPaymentTimeOut();
    }
}
